package com.apobates.forum.toro.test.entity;

public class SingleArgument {
    /**
     * 要设置Vo哪个属性
     * 例: Vo.product
     */
    private String targetAttr;
    /**
     * 集合的类型
     */
    private String collectionType;
    /**
     * 使用参数的哪个属性的的值作为Select参数
     * 例: Vo.productId
     */
    private String selectAttr;
    /**
     * selectAttr的类型名称
     * 例: 基础类型: long, 类类型: java.lang.Long
     */
    private String selectAttrTypeName;

    public SingleArgument() {
    }

    public String getTargetAttr() {
        return targetAttr;
    }

    public void setTargetAttr(String targetAttr) {
        this.targetAttr = targetAttr;
    }

    public String getCollectionType() {
        return collectionType;
    }

    public void setCollectionType(String collectionType) {
        this.collectionType = collectionType;
    }

    public String getSelectAttr() {
        return selectAttr;
    }

    public void setSelectAttr(String selectAttr) {
        this.selectAttr = selectAttr;
    }

    public String getSelectAttrTypeName() {
        return selectAttrTypeName;
    }

    public void setSelectAttrTypeName(String selectAttrTypeName) {
        this.selectAttrTypeName = selectAttrTypeName;
    }

    @Override
    public String toString() {
        // targetAttr:collectionType=select(selectAttr:selectAttrTypeName)
        return String.format("%s:%s=select(%s:%s)", targetAttr, collectionType, selectAttr, selectAttrTypeName);
    }
}
